import logging
from flask import Flask, session
# from flask_sqlalchemy import SQLAlchemy
# from redis import StrictRedis
# from flask_wtf.csrf import CSRFProtect
# from flask_session import Session
from flask import current_app
from flask_script import Manager
# from config import Config
from flask_migrate import MigrateCommand, Migrate
from info import create_app,db

app=create_app("development")
# class Config(object):
#     """工程配置信息"""
#     DEBUG = True
#     SECRET_KEY = "EjpNVSNQTyGi1VvWECj9TvC/+kq3oujee2kTfQUs8yCM6xX9Yjq52v54g+HVoknA"
#
#     SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/information"
#     SQLALCHEMY_TRACK_MODIFICATIONS = False
#
#     REDIS_HOST = "127.0.0.1"
#     REDIS_PORT = 6379
#     SESSION_TYPE = "redis"
#     SESSION_USE_SIGNER = True
#     SESSION_REDIS =StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
#     SESSION_PERMANENT = False
#     PERMANENT_SESSION_LIFETIME = 86400

# app = Flask(__name__)
# app.config.from_object(Config)
# db = SQLAlchemy(app)
# redis_store = StrictRedis(host=Config.REconfig_nameDIS_HOST, port=Config.REDIS_PORT)
# CSRFProtect(app)
# Session(app)
manager = Manager(app)
Migrate(app, db)
manager.add_command('db', MigrateCommand)


# @app.route("/")
# def index():
#     # session['name'] = 'itheima'
#     logging.debug("This is a debug log.")
#     logging.info("This is a info log.")
#     logging.warning("This is a warning log.")
#     logging.error("This is a error log.")
#
#     current_app.logger.error()
#     return "hellk word cai"

if __name__ == '__main__':
    manager.run()